package com.thekernel.youdaoyun.mapper;

import com.thekernel.youdaoyun.bean.Feedback;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Options;
import org.springframework.stereotype.Component;

/**
 * @Author: thekernel
 * @Date: 2020/3/25 21:58
 * @Version: 1.0
 * @Description:
 */
@Component
@Mapper
public interface FeedbackMapper {

    /**
     * 添加反馈
     *
     * @param feedback 反馈内容
     * @return 0: 添加失败 1: 添加成功
     */
    @Insert("INSERT INTO `feedback`(`content`, `type`, `user_id`) VALUES(#{content}, #{type}, #{userId})")
    @Options(useGeneratedKeys = true, keyProperty = "id")
    int add(Feedback feedback);

}
